package top.lingkang.securityoauth2.core;

import javax.servlet.http.HttpServletRequest;

/**
 * @author lingkang
 * Created by 2022/7/1
 */
public class DefaultAccessTokenHandleImpl implements AccessTokenHandle {
    @Override
    public String getToken(HttpServletRequest request) {
        String token = request.getHeader("Authorization");
        if (token != null && token.startsWith("Bearer ")) {
            return token.substring(7);
        }
        return request.getParameter("access_token");
    }

    @Override
    public String getRefreshToken(HttpServletRequest request) {

        return null;
    }
}
